#include <hxcpp.h>

#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_jax_lang_JBoolean
#include <jax/lang/JBoolean.h>
#endif
namespace jax{
namespace lang{

Void JBoolean_obj::__construct(Dynamic v)
{
{
	HX_SOURCE_POS("Source/jax/lang/JBoolean.hx",11)
	this->_native = (  ((::Std_obj::is(v,hx::ClassOf< ::Bool >()))) ? bool(v) : bool((  ((::Std_obj::is(v,hx::ClassOf< ::String >()))) ? bool((v->__Field(HX_CSTRING("toLowerCase"),true)() == HX_CSTRING("true"))) : bool(false) )) );
}
;
	return null();
}

JBoolean_obj::~JBoolean_obj() { }

Dynamic JBoolean_obj::__CreateEmpty() { return  new JBoolean_obj; }
hx::ObjectPtr< JBoolean_obj > JBoolean_obj::__new(Dynamic v)
{  hx::ObjectPtr< JBoolean_obj > result = new JBoolean_obj();
	result->__construct(v);
	return result;}

Dynamic JBoolean_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< JBoolean_obj > result = new JBoolean_obj();
	result->__construct(inArgs[0]);
	return result;}

int JBoolean_obj::hashCode( ){
	HX_SOURCE_PUSH("JBoolean_obj::hashCode")
	HX_SOURCE_POS("Source/jax/lang/JBoolean.hx",19)
	return (  ((this->_native)) ? int((int)1231) : int((int)1237) );
}


HX_DEFINE_DYNAMIC_FUNC0(JBoolean_obj,hashCode,return )

::String JBoolean_obj::toString( ){
	HX_SOURCE_PUSH("JBoolean_obj::toString")
	HX_SOURCE_POS("Source/jax/lang/JBoolean.hx",22)
	return ::jax::lang::JBoolean_obj::toString__(this->_native);
}


HX_DEFINE_DYNAMIC_FUNC0(JBoolean_obj,toString,return )

bool JBoolean_obj::booleanValue( ){
	HX_SOURCE_PUSH("JBoolean_obj::booleanValue")
	HX_SOURCE_POS("Source/jax/lang/JBoolean.hx",25)
	return this->_native;
}


HX_DEFINE_DYNAMIC_FUNC0(JBoolean_obj,booleanValue,return )

bool JBoolean_obj::equals( Dynamic other){
	HX_SOURCE_PUSH("JBoolean_obj::equals")
	HX_SOURCE_POS("Source/jax/lang/JBoolean.hx",28)
	return (bool((bool((other != null())) && bool(::Std_obj::is(other,hx::ClassOf< ::jax::lang::JBoolean >())))) && bool((this->_native == other->__Field(HX_CSTRING("_native"),true))));
}


HX_DEFINE_DYNAMIC_FUNC1(JBoolean_obj,equals,return )

int JBoolean_obj::compareTo( ::jax::lang::JBoolean b){
	HX_SOURCE_PUSH("JBoolean_obj::compareTo")
	HX_SOURCE_POS("Source/jax/lang/JBoolean.hx",31)
	return (  (((this->_native == b->_native))) ? Dynamic((int)0) : Dynamic((  (((bool(this->_native) && bool(!(b->_native))))) ? Dynamic((int)1) : Dynamic((  (((bool(!(this->_native)) && bool(b->_native)))) ? Dynamic((int)-1) : Dynamic(null()) )) )) );
}


HX_DEFINE_DYNAMIC_FUNC1(JBoolean_obj,compareTo,return )

::jax::lang::JBoolean JBoolean_obj::TRUE;

::jax::lang::JBoolean JBoolean_obj::FALSE;

int JBoolean_obj::compare( bool a,bool b){
	HX_SOURCE_PUSH("JBoolean_obj::compare")
	HX_SOURCE_POS("Source/jax/lang/JBoolean.hx",39)
	return (  (((a == b))) ? Dynamic((int)0) : Dynamic((  (((bool(a) && bool(!(b))))) ? Dynamic((int)1) : Dynamic((  (((bool(!(a)) && bool(b)))) ? Dynamic((int)-1) : Dynamic(null()) )) )) );
}


STATIC_HX_DEFINE_DYNAMIC_FUNC2(JBoolean_obj,compare,return )

::String JBoolean_obj::toString__( bool b){
	HX_SOURCE_PUSH("JBoolean_obj::toString__")
	HX_SOURCE_POS("Source/jax/lang/JBoolean.hx",47)
	return (  ((b)) ? ::String(HX_CSTRING("true")) : ::String(HX_CSTRING("false")) );
}


STATIC_HX_DEFINE_DYNAMIC_FUNC1(JBoolean_obj,toString__,return )

::jax::lang::JBoolean JBoolean_obj::getBoolean( ::String name){
	HX_SOURCE_PUSH("JBoolean_obj::getBoolean")
	HX_SOURCE_POS("Source/jax/lang/JBoolean.hx",50)
	return null();
}


STATIC_HX_DEFINE_DYNAMIC_FUNC1(JBoolean_obj,getBoolean,return )

::jax::lang::JBoolean JBoolean_obj::parseBoolean( ::String v){
	HX_SOURCE_PUSH("JBoolean_obj::parseBoolean")
	HX_SOURCE_POS("Source/jax/lang/JBoolean.hx",53)
	return ::jax::lang::JBoolean_obj::valueOf((v.toLowerCase() == HX_CSTRING("true")));
}


STATIC_HX_DEFINE_DYNAMIC_FUNC1(JBoolean_obj,parseBoolean,return )

::jax::lang::JBoolean JBoolean_obj::valueOf( Dynamic v){
	HX_SOURCE_PUSH("JBoolean_obj::valueOf")
	HX_SOURCE_POS("Source/jax/lang/JBoolean.hx",56)
	return (  (((  ((::Std_obj::is(v,hx::ClassOf< ::Bool >()))) ? bool(v) : bool((v->__Field(HX_CSTRING("toLowerCase"),true)() == HX_CSTRING("true"))) ))) ? ::jax::lang::JBoolean(::jax::lang::JBoolean_obj::TRUE) : ::jax::lang::JBoolean(::jax::lang::JBoolean_obj::FALSE) );
}


STATIC_HX_DEFINE_DYNAMIC_FUNC1(JBoolean_obj,valueOf,return )


JBoolean_obj::JBoolean_obj()
{
}

void JBoolean_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(JBoolean);
	HX_MARK_MEMBER_NAME(_native,"_native");
	HX_MARK_END_CLASS();
}

void JBoolean_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(_native,"_native");
}

Dynamic JBoolean_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 4:
		if (HX_FIELD_EQ(inName,"TRUE") ) { return TRUE; }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"FALSE") ) { return FALSE; }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"equals") ) { return equals_dyn(); }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"compare") ) { return compare_dyn(); }
		if (HX_FIELD_EQ(inName,"valueOf") ) { return valueOf_dyn(); }
		if (HX_FIELD_EQ(inName,"_native") ) { return _native; }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"hashCode") ) { return hashCode_dyn(); }
		if (HX_FIELD_EQ(inName,"toString") ) { return toString_dyn(); }
		break;
	case 9:
		if (HX_FIELD_EQ(inName,"compareTo") ) { return compareTo_dyn(); }
		break;
	case 10:
		if (HX_FIELD_EQ(inName,"toString__") ) { return toString___dyn(); }
		if (HX_FIELD_EQ(inName,"getBoolean") ) { return getBoolean_dyn(); }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"parseBoolean") ) { return parseBoolean_dyn(); }
		if (HX_FIELD_EQ(inName,"booleanValue") ) { return booleanValue_dyn(); }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic JBoolean_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 4:
		if (HX_FIELD_EQ(inName,"TRUE") ) { TRUE=inValue.Cast< ::jax::lang::JBoolean >(); return inValue; }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"FALSE") ) { FALSE=inValue.Cast< ::jax::lang::JBoolean >(); return inValue; }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"_native") ) { _native=inValue.Cast< bool >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void JBoolean_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("_native"));
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	HX_CSTRING("TRUE"),
	HX_CSTRING("FALSE"),
	HX_CSTRING("compare"),
	HX_CSTRING("toString__"),
	HX_CSTRING("getBoolean"),
	HX_CSTRING("parseBoolean"),
	HX_CSTRING("valueOf"),
	String(null()) };

static ::String sMemberFields[] = {
	HX_CSTRING("_native"),
	HX_CSTRING("hashCode"),
	HX_CSTRING("toString"),
	HX_CSTRING("booleanValue"),
	HX_CSTRING("equals"),
	HX_CSTRING("compareTo"),
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
	HX_MARK_MEMBER_NAME(JBoolean_obj::TRUE,"TRUE");
	HX_MARK_MEMBER_NAME(JBoolean_obj::FALSE,"FALSE");
};

static void sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(JBoolean_obj::__mClass,"__mClass");
	HX_VISIT_MEMBER_NAME(JBoolean_obj::TRUE,"TRUE");
	HX_VISIT_MEMBER_NAME(JBoolean_obj::FALSE,"FALSE");
};

Class JBoolean_obj::__mClass;

void JBoolean_obj::__register()
{
	Static(__mClass) = hx::RegisterClass(HX_CSTRING("jax.lang.JBoolean"), hx::TCanCast< JBoolean_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics, sVisitStatics);
}

void JBoolean_obj::__boot()
{
	hx::Static(TRUE) = ::jax::lang::JBoolean_obj::__new(true);
	hx::Static(FALSE) = ::jax::lang::JBoolean_obj::__new(false);
}

} // end namespace jax
} // end namespace lang
